home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tcplusx.zip / CURSOR.H < prev    next >
C/C++ Source or Header  |  1991-02-28  |  3KB  |  141 lines

  1. #ifndef _CURSOR_H
  2. #define _CURSOR_H
  3.  
  4. //
  5. // cursor.h     - header file for class Cursor
  6. // Author        - Robin W. McKean
  7. // Last Update    - February 23,1991
  8. // Copyright (C) 1991 All rights reserved
  9. //
  10. // This file remains the property of the author, Robin W. McKean.  You are
  11. // free to use and change it as you see fit.  This module, nor its object
  12. // code, may not however be included  in any packaged software without the
  13. // written consent of the author.
  14. //
  15.  
  16. // Contents ----------------------------------------------------------------
  17. //
  18. //        Cursor
  19. //
  20. // Description
  21. //
  22. //        Defines the class Cursor.  The purpose of this class is to serve
  23. //        as a cursor device for moving around and positioning on the screen.
  24. //        It does not create or return any events, it just responds to events
  25. //        passed to it from the program.
  26. //
  27. // End ---------------------------------------------------------------------
  28.  
  29. // Interface Dependencies ---------------------------------------------------
  30.  
  31. #ifndef _IOSTREAM_H
  32. #include <iostream.h>
  33. #define _IOSTREAM_H
  34. #endif
  35.  
  36. #ifndef _GEN_H
  37. #include <gen.h>
  38. #endif
  39.  
  40. #ifndef _USETYPES_H
  41. #include <usetypes.h>
  42. #endif
  43.  
  44. #ifndef _OBJECT_H
  45. #include <object.h>
  46. #endif
  47.  
  48. #ifndef _EVENT_H
  49. #include <event.h>
  50. #endif
  51.  
  52. #ifndef _DEVICE_H
  53. #include <device.h>
  54. #endif
  55.  
  56. // End Interface Dependencies ------------------------------------------------
  57.  
  58. // Class //
  59.  
  60. class Cursor : public Device
  61. {
  62. public:
  63.     Cursor( int initStatus = D_ON );
  64.     Cursor( Device& );
  65.     ~Cursor( void );
  66.  
  67.     classType        isA( ) const;
  68.     char            *nameOf( ) const;
  69.  
  70.     int             processA( Event& );
  71.     void            pollDevice( );
  72.  
  73. private:
  74.     int             initialCursorState;
  75.     int                oldCursorState;
  76.     int                currentCursorState;
  77.     int                line;
  78.     int                column;
  79. };
  80.  
  81. // Description --------------------------------------------------------------
  82. //
  83. //        The cursor class does not process any events.  It merely responds
  84. //        to events as passed to it.
  85. //
  86. //    Constructor
  87. //
  88. //        Cursor( int initStatus = D_ON )
  89. //
  90. //        Initializes the device, and determines its initial status.  It also
  91. //        saves information needed to restore the cursor upon destruction
  92. //
  93. //        Cursor( Cursor& )
  94. //
  95. //        Copy constructor, copies one device into another.  
  96. //
  97. //    Destructor
  98. //
  99. //        ~Cursor()
  100. //
  101. //        Resets the cursor to the way it was when this object was created
  102. //
  103. //    Member Functions
  104. //
  105. //        isA( )
  106. //
  107. //        Returns character class type cursorClass
  108. //
  109. //        nameOf( )
  110. //
  111. //        Returns a character representation of class, "Cursor"
  112. //
  113. //        printOn( ostream& )
  114. //
  115. //        Prints the contents of the class in a logical fashion
  116. //
  117. //        processA( Event& )
  118. //
  119. //        Responsible for taking an event, and processing the contents if
  120. //        applicable to this device
  121. //
  122. //        pollDevice( )
  123. //
  124. //        Requests information from a device, and translated into an event
  125. //        which is fed directly into the event manager's queue.  Remeber, the
  126. //        cursor doesn't return any events.
  127. //
  128. //    Inherited Members
  129. //
  130. //        isSortable( )        inherited from Object
  131. //        isAssociation( )    inherited from Object
  132. //        operator new        inherited from Object
  133. //        firstThat( )        inherited from Object
  134. //        lastThat( )         inherited from Object
  135. //        hashValue( )        inherited from Device
  136. //        isEqual( )            inherited from Device
  137. //
  138. // End Description ----------------------------------------------------------
  139.  
  140. #endif    // _CURSOR_H //
  141.